package light.head.model.el;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Formula;
/**
 * 学习情况
 */
@Table
@Entity
public class Learn implements Serializable{
	
	private static final long serialVersionUID = 3452389877704197306L;
	
	private Integer code;
	private Integer clc;			// 班级编号
	private Integer cc;				// 课程编号
	private Integer tmc;			// 培训资料编号
	private Integer tmac;			// 培训资料附件编号
	private Integer cu;				// 学员编号
	private Long time;				// 学习时长
	private Integer page;			// 浏览页记录
	private Boolean deleted = false; // 屏蔽标识 
	
	private String tmn;				// 培训资料
	private String tman;			// 培训资料附件名称
	private String tmsn;
	private String tmext;
	
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public Integer getClc() {
		return clc;
	}
	@Column
	public Integer getCc() {
		return cc;
	}
	@Column
	public Integer getTmc() {
		return tmc;
	}
	@Column
	public Integer getTmac() {
		return tmac;
	}
	@Column
	public Integer getCu() {
		return cu;
	}
	@Column
	public Integer getPage() {
		return page;
	}
	@Column
	public Long getTime() {
		return time;
	}
	@Column
	public Boolean getDeleted() {
		return deleted;
	}
	@Formula("(SELECT tm.name FROM TrainData tm WHERE tm.code = tmc AND tm.deleted = 0 )")
	public String getTmn() {
		return tmn;
	}
	@Formula("(SELECT tma.name FROM TrainDataAnnex tma WHERE tma.code = tmac)")
	public String getTman() {
		return tman;
	}
	@Formula("(SELECT tma.sn FROM TrainDataAnnex tma WHERE tma.code = tmac)")
	public String getTmsn() {
		return tmsn;
	}
	@Formula("(SELECT tma.ext FROM TrainDataAnnex tma WHERE tma.code = tmac)")
	public String getTmext() {
		return tmext;
	}
	
	
	
	public void setTmsn(String tmsn) {
		this.tmsn = tmsn;
	}
	public void setTmext(String tmext) {
		this.tmext = tmext;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setClc(Integer clc) {
		this.clc = clc;
	}
	public void setCc(Integer cc) {
		this.cc = cc;
	}
	public void setTmc(Integer tmc) {
		this.tmc = tmc;
	}
	public void setTmac(Integer tmac) {
		this.tmac = tmac;
	}
	public void setCu(Integer cu) {
		this.cu = cu;
	}
	public void setTime(Long time) {
		this.time = time;
	}
	public void setPage(Integer page) {
		this.page = page;
	}
	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
	public void setTmn(String tmn) {
		this.tmn = tmn;
	}
	public void setTman(String tman) {
		this.tman = tman;
	}
}
